// {
//   "bodyParas":[
//     {
//       children: [
//         {
//           children: [],
//           code:'adouble',
//           name:'adouble',
//           nodePath:'request.adouble',
//           required:"0",
//           type:'number',
//         },
//         {
//           children: [],
//           code:'adouble2',
//           name:'adouble2',
//           nodePath:'request.adouble2',
//           required:"0",
//           type:'number',
//         },
//         {
//           children: [],
//           code:'afloat',
//           name:'afloat',
//           nodePath:'request.afloat',
//           required:"0",
//           type:'number',
//         },
//         {
//           children:[
//             {
//               children: [],
//               name:'integer',
//               nodePath:'request.children.integer',
//               required:"0",
//               type:'number',
//             },
//             {
//               children: [],
//               name:'str',
//               nodePath:'request.children.str',
//               required:"0",
//               type:'string',
//             },
//             {
//               children: [],
//               name:'str2',
//               nodePath:'request.children.str2',
//               required:"0",
//               type:'string',
//             },
//             {
//               children: [],
//               name:'str3',
//               nodePath:'request.children.str3',
//               required:"0",
//               type:'string',
//             },
//           ],
//           code:'children',
//           name:'children',
//           nodePath:'request.children',
//           required:"0",
//           type:'object',
//         }
//       ],
//       code:'request',
//       name:'request',
//       nodePath:'request',
//       required:"1",
//       type:'object',
//     }
//   ],
//   "pathParas":[
//     {
//       code:'id',
//       name:'id',
//       nodePath:'id',
//       required:"1",
//       type:'string',
//     },
//     {
//       code:'type',
//       name:'type',
//       nodePath:'type',
//       required:"1",
//       type:'string',
//     },
//   ],
//   queryParas: [
//     {
//       code:'id',
//       name:'id',
//       nodePath:'id',
//       required:"0",
//       type:'string',
//     },
//     {
//       code:'type',
//       name:'type',
//       nodePath:'type',
//       required:"0",
//       type:'string',
//     },
//     {
//       code:'name',
//       name:'name',
//       nodePath:'name',
//       required:"0",
//       type:'string',
//     },
//   ],
// }


const originalData =  {
  bodyParas:[
    {
      children: [
        {
          children: [],
          code:'adouble',
          name:'adouble',
          nodePath:'request.adouble',
          required:"0",
          type:'number',
        },
        {
          children: [],
          code:'adouble2',
          name:'adouble2',
          nodePath:'request.adouble2',
          required:"0",
          type:'number',
        },
        {
          children: [],
          code:'afloat',
          name:'afloat',
          nodePath:'request.afloat',
          required:"0",
          type:'number',
        },
        {
          children:[
            {
              children: [],
              name:'integer',
              nodePath:'request.children.integer',
              required:"0",
              type:'number',
            },
            {
              children: [],
              name:'str',
              nodePath:'request.children.str',
              required:"0",
              type:'string',
            },
            {
              children: [],
              name:'str2',
              nodePath:'request.children.str2',
              required:"0",
              type:'string',
            },
            {
              children: [],
              name:'str3',
              nodePath:'request.children.str3',
              required:"0",
              type:'string',
            },
          ],
          code:'children',
          name:'children',
          nodePath:'request.children',
          required:"0",
          type:'object',
        }
      ],
      code:'request',
      name:'request',
      nodePath:'request',
      required:"1",
      type:'object',
    }
  ],
  pathParas:[
    {
      code:'id',
      name:'id',
      nodePath:'id',
      required:"1",
      type:'string',
    },
    {
      code:'type',
      name:'type',
      nodePath:'type',
      required:"1",
      type:'string',
    },
  ],
  queryPara:[
  {
    code:'id',
    name:'id',
    nodePath:'id',
    required:"0",
    type:'string',
  },
  {
    code:'type',
    name:'type',
    nodePath:'type',
    required:"0",
    type:'string',
  },
  {
    code:'name',
    name:'name',
    nodePath:'name',
    required:"0",
    type:'string',
  }
  ],
}

[
  {
    parentName:'bodyParas',
    code:'request',
    name:'request',
    nodePath:'request',
    required:"1",
    type:'object',
    children: [
      {
        children: [],
        code:'adouble',
        name:'adouble',
        nodePath:'request.adouble',
        required:"0",
        type:'number',
      },
      {
        children: [],
        code:'adouble2',
        name:'adouble2',
        nodePath:'request.adouble2',
        required:"0",
        type:'number',
      },
      {
        children: [],
        code:'afloat',
        name:'afloat',
        nodePath:'request.afloat',
        required:"0",
        type:'number',
      },
      {
        children:[
          {
            children: [],
            name:'integer',
            nodePath:'request.children.integer',
            required:"0",
            type:'number',
          },
          {
            children: [],
            name:'str',
            nodePath:'request.children.str',
            required:"0",
            type:'string',
          },
          {
            children: [],
            name:'str2',
            nodePath:'request.children.str2',
            required:"0",
            type:'string',
          },
          {
            children: [],
            name:'str3',
            nodePath:'request.children.str3',
            required:"0",
            type:'string',
          },
        ],
        code:'children',
        name:'children',
        nodePath:'request.children',
        required:"0",
        type:'object',
      }
    ],
  },
  {
    parentName:'pathParas',
    children: [
      {
        code:'id',
        name:'id',
        nodePath:'id',
        required:"1",
        type:'string',
      },
      {
        code:'type',
        name:'type',
        nodePath:'type',
        required:"1",
        type:'string',
      },
    ]
  },
  {
    parentName:'queryPara',
    children: [
      {
        code:'id',
        name:'id',
        nodePath:'id',
        required:"0",
        type:'string',
      },
      {
        code:'type',
        name:'type',
        nodePath:'type',
        required:"0",
        type:'string',
      },
      {
        code:'name',
        name:'name',
        nodePath:'name',
        required:"0",
        type:'string',
      }
    ]
  }
]

function transformData(data) {
  const result = [];

  for (const key in data) {
    if (data.hasOwnProperty(key)) {
      const items = data[key].map(item => ({
        parentName: key,
        ...item
      }));
      result.push(...items);
    }
  }

  return result;
}
const transformedData = transformData(originalData);
console.log('transformedData', transformedData);